<?php 
/**
 *系统常量设置
 *@package Config
 *@author 江羿平<jyp@cjkt.com>
 */

switch (ENVIRONMENT)
{
	case 'development':
		error_reporting(E_ALL);
		ini_set('display_errors', 1);
	break;

	case 'testing':
	case 'production':
		error_reporting(0);
	break;

	default:
		header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
		echo 'The application environment is not set correctly.';
		exit(1); // EXIT_ERROR
}

$system_path = realpath('../system/').'/';
$application_folder = './';
$view_folder = '';


define('BASEPATH', str_replace('\\', '/', $system_path)); //system文件夹路径
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); //system文件夹名称

define('APP_VERSION', 'V1 beta'); //版本号
define('SITE_PATH',str_replace('\\', '/',realpath(BASEPATH.'../')).DIRECTORY_SEPARATOR); //项目总路径
define('SHARED_PATH', SITE_PATH . 'shared'.DIRECTORY_SEPARATOR); //公用资源路径


define('APPPATH', str_replace('\\', '/',realpath($application_folder).DIRECTORY_SEPARATOR)); //当前项目路径
define('VIEWPATH', rtrim(APPPATH.'views', '/\\').DIRECTORY_SEPARATOR);//视图路径

define('APIPATH',SITE_PATH.'api'.DIRECTORY_SEPARATOR);

//URL配置
define('WWW_URL','http://test.rcbao-online.com/'); //主页

define('ENCRYPT_SECRETS', '@@hj78nyui*7t#'); //加密密钥
define('ENCRYPTION_KEY', 'iumhn0iy7497d93ff848fd2d638u7yt5'); //Encryption Key


define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
define("IS_POST", strtolower($_SERVER['REQUEST_METHOD']) == 'post');
define("IS_GET", strtolower($_SERVER['REQUEST_METHOD']) == 'get');

define('REDIS_HOST', '127.0.0.1');
define('REDIS_PORT', '6380');

